package com.smalldragon.yml.auth_token_02;

import com.smalldragon.yml.auth_token_02.Filter.LoginInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
public class AuthToken02Application  implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(AuthToken02Application.class, args);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 使拦截器生效
        registry.addInterceptor(new LoginInterceptor());
    }

}
